package cn.bdqn.appinfo.util;

import java.util.List;

public class Page<T> {
	/**
	 * 当前页码
	 */
	private int pageNo = 1;
	/**
	 * 每页显示的条数
	 */
	private int pageSize = 5;
	/**
	 * 总记录数
	 */
	private int totalCount = 0;
	/**
	 * 总页数
	 */
	private int totalPageCount = 0;
	/**
	 * 存储分好页的数据集合
	 */
	private List<T> dataList;
	public int getPageNo() {
		return pageNo;
	}
	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public int getTotalCount() {
		return totalCount;
	}
	public void setTotalCount(int totalCount) {
		if(totalCount>0) {
			this.totalPageCount = totalCount % pageSize == 0 ? totalCount / pageSize : totalCount / pageSize + 1;
		}
		this.totalCount = totalCount;
	}
	public int getTotalPageCount() {
		return totalPageCount;
	}
	public void setTotalPageCount(int totalPageCount) {
		this.totalPageCount = totalPageCount;
	}
	public List<T> getDataList() {
		return dataList;
	}
	public void setDataList(List<T> dataList) {
		this.dataList = dataList;
	}
	
}
